package cn.bgs.controller;


import cn.bgs.common.R;
import cn.bgs.pojo.HomeStyle;
import cn.bgs.service.HomeStyleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 家乡风貌表 前端控制器
 * </p>
 *
 * @author Mr.Zhao
 * @since 2022-08-08
 */
@RestController
@RequestMapping("/home-style")
public class HomeStyleController {

    @Autowired
    private HomeStyleService homeStyleService;

    @GetMapping("findHomeStyle")
    public R findHomeStyle(@RequestParam String homeStyTitle,@RequestParam String homeStyFrom){
        return homeStyleService.findHomeStyle(homeStyTitle, homeStyFrom);
    }

    @GetMapping("findHomeStyleId")
    public R findHomeStyleId(@RequestParam Integer id){
        return homeStyleService.findHomeStyleId(id);
    }

    @PostMapping("addHomeStyle")
    public R addHomeStyle(@RequestBody HomeStyle homeStyle){
        return homeStyleService.addHomeStyle(homeStyle);
    }

    @PostMapping("updateHomeStyle")
    public R updateHomeStyle(@RequestBody HomeStyle homeStyle){
        return homeStyleService.updateHomeStyle(homeStyle);
    }

    @GetMapping("delHomeStyle")
    public R delHomeStyle(@RequestParam Integer id){
        return homeStyleService.delHomeStyle(id);
    }
}

